package com.translate.web.service;
import java.util.List;

import com.page.PageResponseData;
import com.translate.entity.Order;
import com.translate.vo.contract.IOrderVO;
import com.translate.web.param.contract.IDateRangeParam;
import com.translate.web.param.contract.IIdAndUserIdParam;
import com.translate.web.param.contract.IOrderApplyParam;
import com.translate.web.param.contract.IOrderCommentParam;
import com.translate.web.param.contract.IOrderSearchByTeamParam;
import com.translate.web.param.contract.IPayBehaviorRequestParam;

public interface IOrderService extends IBaseTranslateService<Order> { 
	
	/**
	 * 根据订单id 及 服务类型 获取数据
	 * @param ids
	 * @param serviceType
	 * @return
	 */
	List<Order> getOrdersByIds(long[] ids, int serviceType);
	
	/**
	 * 取消订单？
	 * @param payMangerId
	 * @return
	 */
	boolean isCancelledByPayManager(long userId, long payMangerId);
	
	
	/**
	 * 根据用户id获取待取消的订单
	 * @param payManagerId
	 * @param userId
	 * @return
	 */
	List<Order> getOrdersByPayManagerIdAndUserId(int payManagerId, int userId);

	List<Order> getOrdersByPayManagerIdAndPayType(int payManagerId, int userId);


	/**
	 * 根据团队id获取待取消的订单
	 * @param payManagerId
	 * @param userId
	 * @return
	 */
	List<Order> getOrdersByPayManagerIdAndTeamId(int payManagerId, int teamId);
	
	
	/**
     * 获取团队订单
     * @param ids
     * @param serviceType
     * @return
     */
	<VO extends IOrderVO> PageResponseData<VO> getOrderListByTeam(IOrderSearchByTeamParam searchByTeamParam, Class<VO> target);
	
	
	/**
	 * 评论订单
	 * @return
	 */
	 int commentOrder(IOrderCommentParam param);
	
	
	/**
	 * 取消订单
	 * @param managerId
	 * @param userId
	 * @return
	 */
	int cancelOrder(int managerId, int userId);
	
	
	/**
     * 团长取消订单
     * @param id
     * @param userId
     */
	int cancelOrderByTeam(Integer id, int userId);
	
	/**
     * 取消单个订单
     * @param param
     * @return
     */
	int cancelOrder(IIdAndUserIdParam param);
	
	
	/**
	 * 支付成功
	 * @param behaviorRequestParam
	 * @return
	 */
	int paySuccess(IPayBehaviorRequestParam behaviorRequestParam);
	
	/**
	 * 支付成功
	 * @param behaviorRequestParam
	 * @return
	 */
	int paySuccessByTeam(IPayBehaviorRequestParam behaviorRequestParam);
	
	/**
	 * 根据用户id及支付管理id  获取订单数据
	 * @param behaviorRequestParam
	 * @return
	 */
	List<Order> getOrdersByUserIdAndManagerId(IPayBehaviorRequestParam behaviorRequestParam);
	
	/**
	 * 待确认
	 * @param behaviorRequestParam
	 * @return
	 */
	int toBeConfirmed(IPayBehaviorRequestParam behaviorRequestParam);
	
	/**
	 * 团队待确认
	 * @param behaviorRequestParam
	 * @return
	 */
	int toBeConfirmedByTeam(IPayBehaviorRequestParam behaviorRequestParam);
	
	/**
	 * 余额 使用记录
	 * @param <VO>
	 * @param dateRangeParam
	 * @param target
	 * @return
	 */
	<VO extends IOrderVO> PageResponseData<VO> getOrdersByUseRecharge(
			IDateRangeParam dateRangeParam,
			Class<VO> target,
			byte isRegimental,
			long teamId);
	
	/**
	 * 更新二次服务状态
	 * @param <P>
	 * @param parameter
	 * @return
	 */
	<P extends IIdAndUserIdParam> int updateService(P parameter);
	
	/**
	 * 取消二次服务
	 * @param <P>
	 * @param parameter
	 * @return
	 */
	<P extends IIdAndUserIdParam> int cancelSecondaryService(P parameter, Order dataDetail);

	/**
	 * 报账合同
	 * @param orderApplyParam
	 * @return
	 */
	int applicationForReimbursementContract(IOrderApplyParam orderApplyParam);

	int needTranslationProof(IOrderApplyParam orderApplyParam);
	
	/**
	 * 通过id和用户id删除订单
	 * @return
	 */
	int deleteByIdAndUserId(IIdAndUserIdParam param);
	
	/**
	 * 获取已支付的订单
	 * @param managerId
	 * @param userId
	 * @return
	 */
	List<Order> getAlreadyPaymentByBalance(int managerId, int userId);
	
	/**
	 * 支付管理
	 * @param id
	 * @param userId
	 * @param payManagerId
	 * @return
	 */
	int setPayManagerByOrderData(IPayBehaviorRequestParam behaviorRequestParam, int payManagerId);

	
}
